@layout("/template/container.html",{plugins:["ztree"],js:["/js/module/system/route/index.js"]}){

<div class="layui-body-header">
    <span class="layui-body-header-title">路由列表</span>
</div>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form model-form toolbar" id="queryForm">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <input class="layui-input" type="text" name="id" placeholder="路由名称(接口名)"/>
                            </div>
                            <div class="layui-inline" id="part0">

                            </div>
                            <div class="layui-inline">
                                <select name="status">
                                    <option value=''>路由状态</option>
                                    <option value='0'>审核</option>
                                    <option value='1'>启用</option>
                                    <option value='2'>禁用</option>
                                </select>
                            </div>
                            <div class="layui-inline">
                                <input type="checkbox" name="needToken" lay-filter="needToken" title="需要token" value="1"
                                       lay-skin="primary">
                            </div>
                            <div class="layui-inline">
                                <button class="layui-btn icon-btn" lay-filter="btnSubmit" lay-submit><i
                                        class="layui-icon layui-icon-search"></i>搜索
                                </button>
                            </div>
                        </div>
                    </form>
                    <table class="layui-table" id="table" lay-filter="table"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="validateTpl">
    <input type="checkbox" lay-filter="validateFilter" data-id="{{d.id}}" data-serviceId="{{d.serviceId}}"
           lay-skin="switch" lay-text="检验|忽略" {{d.ignoreValidate==0?'checked':''}}/>
</script>
<script type="text/html" id="mergeTpl">
    <input type="checkbox" lay-filter="mergeFilter" data-id="{{d.id}}" data-serviceId="{{d.serviceId}}"
           lay-skin="switch" lay-text="是|否" {{d.mergeResult==1?'checked':''}}/>
</script>
<script type="text/html" id="tokenTpl">
    <input type="checkbox" lay-filter="tokenFilter" data-id="{{d.id}}" data-serviceId="{{d.serviceId}}"
           lay-skin="switch" lay-text="是|否" {{d.needToken==1?'checked':''}}/>
</script>
<script type="text/html" id="statusTpl">
    <select data-id="{{d.id}}" data-serviceId="{{d.serviceId}}" lay-filter="statusFilter" data-value="{{d.status}}">
        <option value='0'>审核</option>
        <option value='1'>启用</option>
        <option value='2'>禁用</option>
    </select>
</script>

<script type="text/html" id="part0-template">
    <select name="serviceId">
        <option value="">服务名称</option>
        {{# layui.each(d.list, function(index, item){ }}
        <option value="{{item.name}}">{{item.name}}</option>
        {{# }); }}
    </select>
</script>

<div class="layui-hide">
    <div id="part1-template">
        <form id="formContainer" lay-filter="formContainer" class="layui-form model-form">
            <div class="layui-form-item">
                <label class="layui-form-label">路由ID</label>
                <div class="layui-input-block">
                    <input name="routeId" type="text" class="layui-input" readonly
                           style="background-color: #e6e6e6;" value="{{d.routeId}}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色</label>
                <div class="layui-input-block">
                    {{# layui.each(d.list, function(index, item){ }}
                    {{# if(item.checked){ }}
                    <input type="checkbox" name="roleCode" title="{{item.description}}" value="{{item.roleCode}}"
                           lay-skin="primary" checked>
                    {{# } else { }}
                    <input type="checkbox" name="roleCode" title="{{item.description}}" value="{{item.roleCode}}"
                           lay-skin="primary">
                    {{# } }}
                    {{# }); }}
                </div>
            </div>
        </form>
    </div>
</div>

@}